import java.util.Scanner;
class Point {
    private int xPos, yPos;
    public Point(int x, int y) {
        xPos = x;
        yPos = y;
    }
    public boolean equals(Object other) {
        if (this == other)
            return true;
        if (other instanceof Point) {
            Point p = (Point) other;
            if (this.xPos == p.xPos && this.yPos == p.yPos)
                return true;
        }
        return false;
    }
}
public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Object p1 = new Point(sc.nextInt(),sc.nextInt());
        Object p2 = new Point(sc.nextInt(),sc.nextInt());
        System.out.println(p1.equals(p2));
        sc.close();
    }
}
